<?php $this->load->view('global_header'); ?>
<link rel="stylesheet" type="text/css" href="/assets/css/question.css"/>

<!-- 资讯问题 -->
<div class="question  entry">
    <div class="question_content">
        <h5><?php echo $q->author; ?></h5><div class="author">：<?php echo $q->title; ?></div>
        <p><?php echo $q->content; ?></p>
    </div>
    <div class="anwsers">
        <?php foreach ($this->question->q_anwsers($q->id) as $a): ?>
            <div class="anwser">
                <h5><?php echo $a->author; ?></h5>解答：
                <p><?php echo $a->content; ?></p>
                <div class="footer">
                    <div class="time"><?php echo $a->created_at; ?></div>
                    <div class="actions">
                    <?php echo anchor(base_url().'admin.php?c=anwser&m=edit&id' . $a->id, '编辑'); ?>
                    <?php echo anchor(base_url().'admin.php?c=anwser&m=delete&id=' . $a->id, '删除'); ?>
                </div>
            </div>
        </div>
        <?php endforeach; ?>
                </div>


                <div class="footer">
                    <div class="ip">IP:<?php echo $q->ip; ?></div>
                    <div class="time"><?php echo $q->created_at; ?></div>
                    <div class="actions">
            <?php echo anchor(base_url().'admin.php?c=question&m=edit&id=' . $q->id, '编辑'); ?>
            <?php echo anchor(base_url().'admin.php?c=question&m=deleteid=' . $q->id, '删除'); ?>
                </div>
            </div>
        </div>




        <!-- 接单表单 -->
        <div class="error"><?php echo validation_errors(); ?></div>
<?php echo form_open(base_url().'admin.php?c=question&m=addreply'); ?>
<?php echo form_hidden('question_id', $q->id); ?>
                    <div class="form_row">
                        <label for="author">您的称呼</label>
                        <input type="text" name="author" id="author" value="<?php echo set_value('author'); ?>"/>
                    </div>
                    <div class="form_row">
                        <textarea name="content" rows="10" cols="50">
        <?php echo set_value('content'); ?>
                </textarea>
            </div>
            <div class="form_btn">
                <input type="submit" name="submit" value="提交"/>
            </div>


<?php $this->load->view('richeditor'); ?>
<?php $this->load->view('global_footer'); ?>